/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('apds', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CreateFileJobRequest {
  resourceType?: string(name='resourceType'),
  surveyJobId?: long(name='surveyJobId'),
  regionId?: string(name='regionId'),
}

model CreateFileJobResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  success?: boolean(name='Success'),
  error?: string(name='error'),
}

model CreateFileJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateFileJobResponseBody(name='body'),
}

async function createFileJob(request: CreateFileJobRequest): CreateFileJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createFileJobWithOptions(request, headers, runtime);
}

async function createFileJobWithOptions(request: CreateFileJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateFileJobResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['regionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.resourceType)) {
    body['resourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.surveyJobId)) {
    body['surveyJobId'] = request.surveyJobId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateFileJob',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/file-job/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model CreateMigrationGroupRequest {
  description?: string(name='description'),
  extra?: string(name='extra'),
  id?: int32(name='id'),
  name?: string(name='name'),
  regionId?: string(name='regionId'),
}

model CreateMigrationGroupResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  error?: string(name='Error'),
  success?: boolean(name='Success'),
}

model CreateMigrationGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateMigrationGroupResponseBody(name='body'),
}

async function createMigrationGroup(request: CreateMigrationGroupRequest): CreateMigrationGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createMigrationGroupWithOptions(request, headers, runtime);
}

async function createMigrationGroupWithOptions(request: CreateMigrationGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateMigrationGroupResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['regionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.extra)) {
    body['extra'] = request.extra;
  }
  if (!Util.isUnset(request.id)) {
    body['id'] = request.id;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateMigrationGroup',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/migration-group/save-migration-group`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model CreateMigrationJobRequest {
  migrationJobList?: [ 
    {
      destination?: string(name='destination'),
      destinationIp?: string(name='destinationIp'),
      destinationRegion?: string(name='destinationRegion'),
      jobGmtCreate?: string(name='jobGmtCreate'),
      jobGmtModified?: string(name='jobGmtModified'),
      name?: string(name='name'),
      originalPercent?: string(name='originalPercent'),
      originalProgress?: string(name='originalProgress'),
      originalStatus?: string(name='originalStatus'),
      outSideId?: string(name='outSideId'),
      properties?: string(name='properties'),
      source?: string(name='source'),
      sourceIp?: string(name='sourceIp'),
    }
  ](name='migrationJobList'),
  type?: string(name='type'),
}

model CreateMigrationJobResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  error?: string(name='Error'),
  success?: boolean(name='Success'),
}

model CreateMigrationJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateMigrationJobResponseBody(name='body'),
}

async function createMigrationJob(request: CreateMigrationJobRequest): CreateMigrationJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createMigrationJobWithOptions(request, headers, runtime);
}

async function createMigrationJobWithOptions(request: CreateMigrationJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateMigrationJobResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.migrationJobList)) {
    body['migrationJobList'] = request.migrationJobList;
  }
  if (!Util.isUnset(request.type)) {
    body['type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateMigrationJob',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/migration-job/create-migration-jobs`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model CreatePayOrderCallbackRequest {
  data?: string(name='data'),
}

model CreatePayOrderCallbackResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  resultObj?: any(name='ResultObj'),
  success?: boolean(name='Success'),
  synchro?: boolean(name='Synchro'),
}

model CreatePayOrderCallbackResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreatePayOrderCallbackResponseBody(name='body'),
}

async function createPayOrderCallback(request: CreatePayOrderCallbackRequest): CreatePayOrderCallbackResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createPayOrderCallbackWithOptions(request, headers, runtime);
}

async function createPayOrderCallbackWithOptions(request: CreatePayOrderCallbackRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreatePayOrderCallbackResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.data)) {
    query['data'] = request.data;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreatePayOrderCallback',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/sys/user/pop/api/v1/payOrderCallback`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model CreateRefundRequest {
  data?: string(name='data'),
}

model CreateRefundResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  synchro?: boolean(name='Synchro'),
}

model CreateRefundResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateRefundResponseBody(name='body'),
}

async function createRefund(request: CreateRefundRequest): CreateRefundResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createRefundWithOptions(request, headers, runtime);
}

async function createRefundWithOptions(request: CreateRefundRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateRefundResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.data)) {
    query['data'] = request.data;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateRefund',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/sys/user/pop/api/v1/refund`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model CreateSurveyJobRequest {
  ak?: string(name='ak'),
  channel?: string(name='channel'),
  cloudType?: string(name='cloudType'),
  name?: string(name='name'),
  region?: [ string ](name='region'),
  resourceTypeList?: [ string ](name='resourceTypeList'),
  sk?: string(name='sk'),
  tenantId?: string(name='tenantId'),
  zone?: [ string ](name='zone'),
  regionId?: string(name='regionId'),
}

model CreateSurveyJobResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  success?: boolean(name='Success'),
  error?: string(name='error'),
}

model CreateSurveyJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateSurveyJobResponseBody(name='body'),
}

async function createSurveyJob(request: CreateSurveyJobRequest): CreateSurveyJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createSurveyJobWithOptions(request, headers, runtime);
}

async function createSurveyJobWithOptions(request: CreateSurveyJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateSurveyJobResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['regionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.ak)) {
    body['ak'] = request.ak;
  }
  if (!Util.isUnset(request.channel)) {
    body['channel'] = request.channel;
  }
  if (!Util.isUnset(request.cloudType)) {
    body['cloudType'] = request.cloudType;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.region)) {
    body['region'] = request.region;
  }
  if (!Util.isUnset(request.resourceTypeList)) {
    body['resourceTypeList'] = request.resourceTypeList;
  }
  if (!Util.isUnset(request.sk)) {
    body['sk'] = request.sk;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['tenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.zone)) {
    body['zone'] = request.zone;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateSurveyJob',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/winback/add-survey-job`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model CreateSurveyJobOfflineRequest {
  channel?: string(name='channel'),
  cloudType?: string(name='cloudType'),
  fileName?: string(name='fileName'),
  name?: string(name='name'),
  objectName?: string(name='objectName'),
  regionId?: string(name='regionId'),
}

model CreateSurveyJobOfflineResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  success?: boolean(name='Success'),
  error?: string(name='error'),
}

model CreateSurveyJobOfflineResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateSurveyJobOfflineResponseBody(name='body'),
}

async function createSurveyJobOffline(request: CreateSurveyJobOfflineRequest): CreateSurveyJobOfflineResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createSurveyJobOfflineWithOptions(request, headers, runtime);
}

async function createSurveyJobOfflineWithOptions(request: CreateSurveyJobOfflineRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateSurveyJobOfflineResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['regionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.channel)) {
    body['channel'] = request.channel;
  }
  if (!Util.isUnset(request.cloudType)) {
    body['cloudType'] = request.cloudType;
  }
  if (!Util.isUnset(request.fileName)) {
    body['fileName'] = request.fileName;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.objectName)) {
    body['objectName'] = request.objectName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateSurveyJobOffline',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/winback/add-import-survey-job`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DeleteMigrationJobRequest {
  id?: long(name='id'),
}

model DeleteMigrationJobResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  success?: boolean(name='Success'),
  error?: string(name='error'),
}

model DeleteMigrationJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteMigrationJobResponseBody(name='body'),
}

async function deleteMigrationJob(request: DeleteMigrationJobRequest): DeleteMigrationJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteMigrationJobWithOptions(request, headers, runtime);
}

async function deleteMigrationJobWithOptions(request: DeleteMigrationJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteMigrationJobResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    query['id'] = request.id;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteMigrationJob',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/migration-job/remove-migration-job`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DeleteOssFileRequest {
  objectName?: string(name='objectName'),
  regionId?: string(name='regionId'),
}

model DeleteOssFileResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  success?: boolean(name='Success'),
  error?: string(name='error'),
}

model DeleteOssFileResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteOssFileResponseBody(name='body'),
}

async function deleteOssFile(request: DeleteOssFileRequest): DeleteOssFileResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteOssFileWithOptions(request, headers, runtime);
}

async function deleteOssFileWithOptions(request: DeleteOssFileRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteOssFileResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.objectName)) {
    query['objectName'] = request.objectName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['regionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteOssFile',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/file-job/delete-file`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DeleteSurveyJobRequest {
  id?: long(name='id'),
}

model DeleteSurveyJobResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  success?: boolean(name='Success'),
  error?: string(name='error'),
}

model DeleteSurveyJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteSurveyJobResponseBody(name='body'),
}

async function deleteSurveyJob(request: DeleteSurveyJobRequest): DeleteSurveyJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteSurveyJobWithOptions(request, headers, runtime);
}

async function deleteSurveyJobWithOptions(request: DeleteSurveyJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteSurveyJobResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    query['id'] = request.id;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSurveyJob',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/winback/delete-survey-job`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DeleteSurveyResourcesRequest {
  ids?: string(name='ids'),
}

model DeleteSurveyResourcesResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  error?: string(name='Error'),
  success?: boolean(name='Success'),
}

model DeleteSurveyResourcesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteSurveyResourcesResponseBody(name='body'),
}

async function deleteSurveyResources(request: DeleteSurveyResourcesRequest): DeleteSurveyResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteSurveyResourcesWithOptions(request, headers, runtime);
}

async function deleteSurveyResourcesWithOptions(request: DeleteSurveyResourcesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteSurveyResourcesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.ids)) {
    query['ids'] = request.ids;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSurveyResources',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/confirm-resource/destroy`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeMigrationJobConfigResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  success?: boolean(name='Success'),
  error?: string(name='error'),
}

model DescribeMigrationJobConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeMigrationJobConfigResponseBody(name='body'),
}

async function describeMigrationJobConfig(): DescribeMigrationJobConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeMigrationJobConfigWithOptions(headers, runtime);
}

async function describeMigrationJobConfigWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): DescribeMigrationJobConfigResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DescribeMigrationJobConfig',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/migration-job/describe-migration-job-config`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeMigrationJobCountRequest {
  name?: string(name='name'),
  source?: string(name='source'),
  type?: string(name='type'),
  typeList?: [ string ](name='typeList'),
}

model DescribeMigrationJobCountResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  success?: boolean(name='Success'),
  error?: string(name='error'),
}

model DescribeMigrationJobCountResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeMigrationJobCountResponseBody(name='body'),
}

async function describeMigrationJobCount(request: DescribeMigrationJobCountRequest): DescribeMigrationJobCountResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeMigrationJobCountWithOptions(request, headers, runtime);
}

async function describeMigrationJobCountWithOptions(request: DescribeMigrationJobCountRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeMigrationJobCountResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.source)) {
    body['source'] = request.source;
  }
  if (!Util.isUnset(request.type)) {
    body['type'] = request.type;
  }
  if (!Util.isUnset(request.typeList)) {
    body['typeList'] = request.typeList;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMigrationJobCount',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/migration-job/count-migration-jobs`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeOssStsRequest {
  ak?: string(name='ak'),
  cloudType?: string(name='cloudType'),
  region?: string(name='region'),
  regionId?: string(name='regionId'),
  sk?: string(name='sk'),
  tenantId?: string(name='tenantId'),
}

model DescribeOssStsResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  success?: boolean(name='Success'),
  error?: string(name='error'),
}

model DescribeOssStsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeOssStsResponseBody(name='body'),
}

async function describeOssSts(request: DescribeOssStsRequest): DescribeOssStsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeOssStsWithOptions(request, headers, runtime);
}

async function describeOssStsWithOptions(request: DescribeOssStsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeOssStsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.ak)) {
    query['ak'] = request.ak;
  }
  if (!Util.isUnset(request.cloudType)) {
    query['cloudType'] = request.cloudType;
  }
  if (!Util.isUnset(request.region)) {
    query['region'] = request.region;
  }
  if (!Util.isUnset(request.regionId)) {
    query['regionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sk)) {
    query['sk'] = request.sk;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['tenantId'] = request.tenantId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeOssSts',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/file-job/sts`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeSummaryByStatusRequest {
  regionId?: string(name='regionId'),
}

model DescribeSummaryByStatusResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  error?: string(name='Error'),
  success?: boolean(name='Success'),
}

model DescribeSummaryByStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSummaryByStatusResponseBody(name='body'),
}

async function describeSummaryByStatus(request: DescribeSummaryByStatusRequest): DescribeSummaryByStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeSummaryByStatusWithOptions(request, headers, runtime);
}

async function describeSummaryByStatusWithOptions(request: DescribeSummaryByStatusRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeSummaryByStatusResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['regionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSummaryByStatus',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/summary/summary-by-status`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeSummaryByStatusAndGroupRequest {
  regionId?: string(name='regionId'),
}

model DescribeSummaryByStatusAndGroupResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  error?: string(name='Error'),
  success?: boolean(name='Success'),
}

model DescribeSummaryByStatusAndGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSummaryByStatusAndGroupResponseBody(name='body'),
}

async function describeSummaryByStatusAndGroup(request: DescribeSummaryByStatusAndGroupRequest): DescribeSummaryByStatusAndGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeSummaryByStatusAndGroupWithOptions(request, headers, runtime);
}

async function describeSummaryByStatusAndGroupWithOptions(request: DescribeSummaryByStatusAndGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeSummaryByStatusAndGroupResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['regionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSummaryByStatusAndGroup',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/summary/summary-by-status-and-region`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeSurveyJobRequest {
  id?: long(name='id'),
  regionId?: string(name='regionId'),
}

model DescribeSurveyJobResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  success?: boolean(name='Success'),
  error?: string(name='error'),
}

model DescribeSurveyJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSurveyJobResponseBody(name='body'),
}

async function describeSurveyJob(request: DescribeSurveyJobRequest): DescribeSurveyJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeSurveyJobWithOptions(request, headers, runtime);
}

async function describeSurveyJobWithOptions(request: DescribeSurveyJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeSurveyJobResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    query['id'] = request.id;
  }
  if (!Util.isUnset(request.regionId)) {
    query['regionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSurveyJob',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/winback/query-survey-job`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeSurveyJobCountRequest {
  channelList?: [ string ](name='channelList'),
  cloudTypeList?: [ string ](name='cloudTypeList'),
  name?: string(name='name'),
  regionId?: string(name='regionId'),
}

model DescribeSurveyJobCountResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  success?: boolean(name='Success'),
  error?: string(name='error'),
}

model DescribeSurveyJobCountResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSurveyJobCountResponseBody(name='body'),
}

async function describeSurveyJobCount(request: DescribeSurveyJobCountRequest): DescribeSurveyJobCountResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeSurveyJobCountWithOptions(request, headers, runtime);
}

async function describeSurveyJobCountWithOptions(request: DescribeSurveyJobCountRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeSurveyJobCountResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['regionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.channelList)) {
    body['channelList'] = request.channelList;
  }
  if (!Util.isUnset(request.cloudTypeList)) {
    body['cloudTypeList'] = request.cloudTypeList;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSurveyJobCount',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/winback/count-survey-job`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeSurveyResourceTagResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  error?: string(name='Error'),
  success?: boolean(name='Success'),
}

model DescribeSurveyResourceTagResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSurveyResourceTagResponseBody(name='body'),
}

async function describeSurveyResourceTag(): DescribeSurveyResourceTagResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeSurveyResourceTagWithOptions(headers, runtime);
}

async function describeSurveyResourceTagWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): DescribeSurveyResourceTagResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DescribeSurveyResourceTag',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/confirm-resource/get-resource-tag`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeSurveyTemplateRequest {
  resourceType?: string(name='resourceType'),
}

model DescribeSurveyTemplateResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  success?: boolean(name='Success'),
  error?: string(name='error'),
}

model DescribeSurveyTemplateResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSurveyTemplateResponseBody(name='body'),
}

async function describeSurveyTemplate(request: DescribeSurveyTemplateRequest): DescribeSurveyTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeSurveyTemplateWithOptions(request, headers, runtime);
}

async function describeSurveyTemplateWithOptions(request: DescribeSurveyTemplateRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeSurveyTemplateResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.resourceType)) {
    query['resourceType'] = request.resourceType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSurveyTemplate',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/survey-template/list`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model ListMigrationJobsRequest {
  name?: string(name='name'),
  pageNum?: int32(name='pageNum'),
  pageSize?: int32(name='pageSize'),
  sortCol?: string(name='sortCol'),
  sortType?: string(name='sortType'),
  source?: string(name='source'),
  type?: string(name='type'),
  typeList?: [ string ](name='typeList'),
}

model ListMigrationJobsResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  success?: boolean(name='Success'),
  error?: string(name='error'),
}

model ListMigrationJobsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListMigrationJobsResponseBody(name='body'),
}

async function listMigrationJobs(request: ListMigrationJobsRequest): ListMigrationJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listMigrationJobsWithOptions(request, headers, runtime);
}

async function listMigrationJobsWithOptions(request: ListMigrationJobsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListMigrationJobsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.pageNum)) {
    body['pageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sortCol)) {
    body['sortCol'] = request.sortCol;
  }
  if (!Util.isUnset(request.sortType)) {
    body['sortType'] = request.sortType;
  }
  if (!Util.isUnset(request.source)) {
    body['source'] = request.source;
  }
  if (!Util.isUnset(request.type)) {
    body['type'] = request.type;
  }
  if (!Util.isUnset(request.typeList)) {
    body['typeList'] = request.typeList;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListMigrationJobs',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/migration-job/describe-migration-jobs`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model ListSurveyJobDownLoadJobsRequest {
  pageNum?: int32(name='pageNum'),
  pageSize?: int32(name='pageSize'),
  sortCol?: string(name='sortCol'),
  sortType?: string(name='sortType'),
  regionId?: string(name='regionId'),
}

model ListSurveyJobDownLoadJobsResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  success?: boolean(name='Success'),
  error?: string(name='error'),
}

model ListSurveyJobDownLoadJobsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListSurveyJobDownLoadJobsResponseBody(name='body'),
}

async function listSurveyJobDownLoadJobs(request: ListSurveyJobDownLoadJobsRequest): ListSurveyJobDownLoadJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listSurveyJobDownLoadJobsWithOptions(request, headers, runtime);
}

async function listSurveyJobDownLoadJobsWithOptions(request: ListSurveyJobDownLoadJobsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListSurveyJobDownLoadJobsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['regionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.pageNum)) {
    body['pageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sortCol)) {
    body['sortCol'] = request.sortCol;
  }
  if (!Util.isUnset(request.sortType)) {
    body['sortType'] = request.sortType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListSurveyJobDownLoadJobs',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/file-job/list`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model ListSurveyJobsRequest {
  channelList?: [ string ](name='channelList'),
  cloudTypeList?: [ string ](name='cloudTypeList'),
  name?: string(name='name'),
  regionId?: string(name='regionId'),
}

model ListSurveyJobsResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  success?: boolean(name='Success'),
  error?: string(name='error'),
}

model ListSurveyJobsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListSurveyJobsResponseBody(name='body'),
}

async function listSurveyJobs(request: ListSurveyJobsRequest): ListSurveyJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listSurveyJobsWithOptions(request, headers, runtime);
}

async function listSurveyJobsWithOptions(request: ListSurveyJobsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListSurveyJobsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['regionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.channelList)) {
    body['channelList'] = request.channelList;
  }
  if (!Util.isUnset(request.cloudTypeList)) {
    body['cloudTypeList'] = request.cloudTypeList;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListSurveyJobs',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/winback/query-survey-jobs`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model ListSurveyResourceByMigrationGroupsRequest {
  body?: {
    ids?: [ int32 ](name='ids'),
  }(name='body'),
}

model ListSurveyResourceByMigrationGroupsShrinkRequest {
  bodyShrink?: string(name='body'),
}

model ListSurveyResourceByMigrationGroupsResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  error?: string(name='Error'),
  success?: boolean(name='Success'),
}

model ListSurveyResourceByMigrationGroupsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListSurveyResourceByMigrationGroupsResponseBody(name='body'),
}

async function listSurveyResourceByMigrationGroups(request: ListSurveyResourceByMigrationGroupsRequest): ListSurveyResourceByMigrationGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listSurveyResourceByMigrationGroupsWithOptions(request, headers, runtime);
}

async function listSurveyResourceByMigrationGroupsWithOptions(tmpReq: ListSurveyResourceByMigrationGroupsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListSurveyResourceByMigrationGroupsResponse {
  Util.validateModel(tmpReq);
  var request = new ListSurveyResourceByMigrationGroupsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.body)) {
    request.bodyShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.body, 'body', 'json');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.bodyShrink)) {
    query['body'] = request.bodyShrink;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListSurveyResourceByMigrationGroups',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/migration-group/get-survey-resource`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model ListSurveyResourceConnectionsRequest {
  ids?: [ int32 ](name='ids'),
  regionId?: string(name='regionId'),
}

model ListSurveyResourceConnectionsResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  error?: string(name='Error'),
  success?: boolean(name='Success'),
}

model ListSurveyResourceConnectionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListSurveyResourceConnectionsResponseBody(name='body'),
}

async function listSurveyResourceConnections(request: ListSurveyResourceConnectionsRequest): ListSurveyResourceConnectionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listSurveyResourceConnectionsWithOptions(request, headers, runtime);
}

async function listSurveyResourceConnectionsWithOptions(request: ListSurveyResourceConnectionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListSurveyResourceConnectionsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['regionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.ids)) {
    body['ids'] = request.ids;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListSurveyResourceConnections',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/resource-connects`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model ListSurveyResourceTypesRequest {
  ak?: string(name='ak'),
  cloudType?: string(name='cloudType'),
  region?: string(name='region'),
  regionId?: string(name='regionId'),
  sk?: string(name='sk'),
}

model ListSurveyResourceTypesResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  success?: boolean(name='Success'),
  error?: string(name='error'),
}

model ListSurveyResourceTypesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListSurveyResourceTypesResponseBody(name='body'),
}

async function listSurveyResourceTypes(request: ListSurveyResourceTypesRequest): ListSurveyResourceTypesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listSurveyResourceTypesWithOptions(request, headers, runtime);
}

async function listSurveyResourceTypesWithOptions(request: ListSurveyResourceTypesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListSurveyResourceTypesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.ak)) {
    query['ak'] = request.ak;
  }
  if (!Util.isUnset(request.cloudType)) {
    query['cloudType'] = request.cloudType;
  }
  if (!Util.isUnset(request.region)) {
    query['region'] = request.region;
  }
  if (!Util.isUnset(request.regionId)) {
    query['regionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sk)) {
    query['sk'] = request.sk;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListSurveyResourceTypes',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/winback/query-resource-type`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model ListSurveyResourcesDetailRequest {
  ip?: string(name='ip'),
  jobId?: long(name='jobId'),
  projectId?: long(name='projectId'),
  resourceType?: string(name='resourceType'),
  subProjectId?: long(name='subProjectId'),
  regionId?: string(name='regionId'),
}

model ListSurveyResourcesDetailResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  success?: boolean(name='Success'),
  error?: string(name='error'),
}

model ListSurveyResourcesDetailResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListSurveyResourcesDetailResponseBody(name='body'),
}

async function listSurveyResourcesDetail(request: ListSurveyResourcesDetailRequest): ListSurveyResourcesDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listSurveyResourcesDetailWithOptions(request, headers, runtime);
}

async function listSurveyResourcesDetailWithOptions(request: ListSurveyResourcesDetailRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListSurveyResourcesDetailResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['regionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.ip)) {
    body['ip'] = request.ip;
  }
  if (!Util.isUnset(request.jobId)) {
    body['jobId'] = request.jobId;
  }
  if (!Util.isUnset(request.projectId)) {
    body['projectId'] = request.projectId;
  }
  if (!Util.isUnset(request.resourceType)) {
    body['resourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.subProjectId)) {
    body['subProjectId'] = request.subProjectId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListSurveyResourcesDetail',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/survey-detail/query`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model RecoverMigrationJobRequest {
  id?: long(name='id'),
}

model RecoverMigrationJobResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  success?: boolean(name='Success'),
  error?: string(name='error'),
}

model RecoverMigrationJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RecoverMigrationJobResponseBody(name='body'),
}

async function recoverMigrationJob(request: RecoverMigrationJobRequest): RecoverMigrationJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return recoverMigrationJobWithOptions(request, headers, runtime);
}

async function recoverMigrationJobWithOptions(request: RecoverMigrationJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RecoverMigrationJobResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    query['id'] = request.id;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RecoverMigrationJob',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/migration-job/recover-migration-job`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model StopSyncMigrationJobRequest {
  jobType?: string(name='jobType'),
  regionId?: string(name='regionId'),
}

model StopSyncMigrationJobResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  success?: boolean(name='Success'),
  error?: string(name='error'),
}

model StopSyncMigrationJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: StopSyncMigrationJobResponseBody(name='body'),
}

async function stopSyncMigrationJob(request: StopSyncMigrationJobRequest): StopSyncMigrationJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return stopSyncMigrationJobWithOptions(request, headers, runtime);
}

async function stopSyncMigrationJobWithOptions(request: StopSyncMigrationJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): StopSyncMigrationJobResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.jobType)) {
    query['jobType'] = request.jobType;
  }
  if (!Util.isUnset(request.regionId)) {
    query['regionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StopSyncMigrationJob',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/migration-job/unsync-migration-job`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model SyncMigrationJobRequest {
  jobType?: string(name='jobType'),
  operationType?: string(name='operationType'),
  regionId?: string(name='regionId'),
  regions?: string(name='regions'),
}

model SyncMigrationJobResponseBody = {
  code?: string(name='Code'),
  data?: any(name='Data'),
  success?: boolean(name='Success'),
  error?: string(name='error'),
}

model SyncMigrationJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SyncMigrationJobResponseBody(name='body'),
}

async function syncMigrationJob(request: SyncMigrationJobRequest): SyncMigrationJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return syncMigrationJobWithOptions(request, headers, runtime);
}

async function syncMigrationJobWithOptions(request: SyncMigrationJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): SyncMigrationJobResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.jobType)) {
    query['jobType'] = request.jobType;
  }
  if (!Util.isUnset(request.operationType)) {
    query['operationType'] = request.operationType;
  }
  if (!Util.isUnset(request.regionId)) {
    query['regionId'] = request.regionId;
  }
  if (!Util.isUnset(request.regions)) {
    query['regions'] = request.regions;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SyncMigrationJob',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/okss-services/migration-job/sync-migration-job`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model UpdatePushAppHeaders {
  commonHeaders?: map[string]string,
  tenantProxyUid?: string(name='tenant-proxy-uid'),
}

model UpdatePushAppRequest {
  appId?: long(name='AppId'),
  downloadLink?: string(name='DownloadLink'),
}

model UpdatePushAppResponseBody = {
  isDebugEnable?: boolean(name='IsDebugEnable'),
  requestId?: string(name='RequestId'),
  resultObj?: any(name='ResultObj'),
  success?: boolean(name='Success'),
  tipMsg?: string(name='TipMsg'),
}

model UpdatePushAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdatePushAppResponseBody(name='body'),
}

async function updatePushApp(request: UpdatePushAppRequest): UpdatePushAppResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new UpdatePushAppHeaders{};
  return updatePushAppWithOptions(request, headers, runtime);
}

async function updatePushAppWithOptions(request: UpdatePushAppRequest, headers: UpdatePushAppHeaders, runtime: Util.RuntimeOptions): UpdatePushAppResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.downloadLink)) {
    body['DownloadLink'] = request.downloadLink;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.tenantProxyUid)) {
    realHeaders['tenant-proxy-uid'] = Util.toJSONString(headers.tenantProxyUid);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdatePushApp',
    version = '2022-03-31',
    protocol = 'HTTPS',
    pathname = `/abm/app/manager/api/v1/push`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

